Skip to content

build: shared OpenSSL dylibs to deduplicate across main app and plugins#898

Merged
datlechin merged 2 commits into
mainfrom
build/openssl-shared-dylib
Apr 27, 2026
Merged

build: shared OpenSSL dylibs to deduplicate across main app and plugins#898
datlechin merged 2 commits into
mainfrom
build/openssl-shared-dylib

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

  • OpenSSL (libssl + libcrypto) was statically linked into 6+ separate binaries: main app, MySQL, PostgreSQL, Redis, MSSQL, and Cassandra plugins. Each copy adds ~3-5MB.
  • Now builds shared dylibs from the existing static libs and links all targets against them. One copy in Contents/Frameworks/ instead of 6 embedded copies.
  • New scripts/create-openssl-dylibs.sh converts static .a to .dylib with @rpath install names
  • build-release.sh creates arch-specific dylibs before build and embeds them in Frameworks
  • download-libs.sh creates universal dylibs after downloading static libs for local dev
  • Expected savings: ~10-15MB reduction in app bundle size

Test plan

  • Run scripts/create-openssl-dylibs.sh both and verify dylibs created in Libs/dylibs/
  • Build Debug: verify otool -L shows @rpath/libssl.3.dylib on main binary and all plugins
  • Launch app, connect to MySQL/PostgreSQL/Redis over SSL - verify connections work
  • SSH tunnel connection - verify libssh2 still works (uses OpenSSL)
  • Run scripts/build-release.sh arm64 - verify dylibs embedded in Contents/Frameworks/

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0d9329fb2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/download-libs.sh
Comment on lines +67 to +70
# --- OpenSSL shared dylibs ---
echo "Creating OpenSSL shared dylibs for local development..."
if [[ -f "$LIBS_DIR/libcrypto_arm64.a" || -f "$LIBS_DIR/libcrypto.a" ]]; then
scripts/create-openssl-dylibs.sh both
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Run OpenSSL dylib generation on cached lib setups

This new dylib step only runs in the fresh-download path, but download-libs.sh exits early when Libs/.downloaded or existing *.a files are present. On machines that already had libraries before this commit, rerunning the script will skip this block and never create Libs/dylibs/libssl.3.dylib/libcrypto.3.dylib, so Xcode link steps that now require -lssl.3 and -lcrypto.3 fail until the user runs the new script manually.

Useful? React with 👍 / 👎.

@datlechin datlechin merged commit 18b12a9 into main Apr 27, 2026
2 checks passed
@datlechin datlechin deleted the build/openssl-shared-dylib branch April 27, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant